package cn.dglydrpy.eshop.website.common.response;

/**
 * 统一返回封装对象
 */
public class ResponseResult {
    private Integer code;
    private String msg;
    private Object data;

    public static ResponseResult create(Object result){
        return ResponseResult.create(result,1,"success");
    }

    public static ResponseResult create(Object result, Integer code,String msg) {
        ResponseResult rr = new ResponseResult();
        rr.setCode(code);
        rr.setMsg(msg);
        rr.setData(result);
        return rr;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
